/* 苹果风格的现代化设计 */
:root {
    --primary-color: #007AFF;
    --primary-hover: #0056CC;
    --secondary-color: #8E8E93;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --background-color: #F2F2F7;
    --surface-color: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-color: #E5E5EA;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.12);
    --border-radius: 12px;
    --border-radius-large: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-system);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 导航栏 */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), #5856D6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.brand-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link.active,
.nav-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 主要内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 英雄区域 */
.hero-section {
    text-align: center;
    margin-bottom: 60px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), #5856D6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 40px;
}

.upload-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    transition: var(--transition);
}

.upload-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.upload-area {
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px dashed transparent;
}

.upload-area:hover {
    background-color: #F8F9FA;
    border-color: var(--primary-color);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary-color), #5856D6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
}

.upload-area h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-area p {
    font-size: 16px;
    color: var(--text-secondary);
}

.file-info {
    padding: 40px;
    border-top: 1px solid var(--border-color);
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.file-preview i {
    font-size: 32px;
    color: var(--success-color);
}

.file-details {
    flex: 1;
}

.file-name {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-meta {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 分析指令区域 */
.prompt-section {
    margin-bottom: 40px;
}

.prompt-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    padding: 40px;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
}

.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.prompt-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

#promptInput {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: var(--font-system);
    resize: vertical;
    transition: var(--transition);
    background: #FAFAFA;
}

#promptInput:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.prompt-examples {
    margin-top: 24px;
}

.examples-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.example-btn {
    padding: 12px 16px;
    background: #F8F9FA;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.example-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 按钮样式 */
.action-section {
    text-align: center;
    margin-bottom: 60px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* 结果区域 */
.result-section {
    margin-bottom: 40px;
}

.result-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    font-size: 16px;
    color: var(--text-secondary);
}

.result-content {
    padding: 40px;
    line-height: 1.8;
    font-size: 16px;
}

.result-content h1,
.result-content h2,
.result-content h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.result-content p {
    margin-bottom: 16px;
}

.result-actions {
    padding: 24px 40px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* 报告列表 */
.reports-header {
    text-align: center;
    margin-bottom: 40px;
}

.reports-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.reports-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

.reports-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#reportSearch {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--surface-color);
    transition: var(--transition);
}

#reportSearch:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 150px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.report-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
}

.report-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.report-info {
    margin-bottom: 16px;
}

.report-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.report-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.report-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.status-completed {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
}

.status-processing {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.status-failed {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
}

.report-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F9FA;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* 通知组件 */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    padding: 16px 20px;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
    max-width: 400px;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    color: var(--primary-color);
    font-size: 18px;
}

.notification-content span {
    font-size: 14px;
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }
    
    .main-content {
        padding: 24px 16px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .upload-area {
        padding: 40px 24px;
    }
    
    .prompt-card {
        padding: 24px;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .reports-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .notification {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #000000;
        --surface-color: #1C1C1E;
        --text-primary: #FFFFFF;
        --text-secondary: #8E8E93;
        --border-color: #38383A;
    }
    
    .navbar {
        background: rgba(28, 28, 30, 0.8);
    }
    
    #promptInput {
        background: #2C2C2E;
        color: var(--text-primary);
    }
    
    #promptInput:focus {
        background: #1C1C1E;
    }
    
    .example-btn {
        background: #2C2C2E;
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    #reportSearch {
        background: #1C1C1E;
        color: var(--text-primary);
    }
    
    .filter-select {
        background: #1C1C1E;
        color: var(--text-primary);
    }
    
    .action-btn {
        background: #2C2C2E;
    }
}